package com.xiaopang.fitment.Pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class R {
    private int code;
    private String msg;
    private Object Data;

    public static R success(){
        R r = new R();
        r.setCode(1);
        r.setMsg("成功");
        return r;
    }

    public static R success(Object data){
        R r = new R();
        r.setCode(1);
        r.setMsg("成功");
        r.setData(data);
        return r;
    }

    public  static R fail(){
        R r = new R();
        r.setCode(0);
        r.setMsg("失败");
        return r;
    }

    public static R fail(Object data){
        R r = new R();
        r.setCode(0);
        r.setMsg("失败");
        r.setData(data);
        return r;
    }
}
